package org.imraniqbal.frogger;

import org.imraniqbal.engine.Item;
import org.imraniqbal.engine.Map;

public class Home extends Item {

	private static final long serialVersionUID = 4973320403573080058L;
	public Home(int x, int y) {
		super(x, y);
	}

	@Override
	public void action(Object obj, Map map) {
		if(!(obj instanceof FroggerGame)){ return; }
		Frogger tempFrogger = ((FroggerGame)obj).getFrogger();
		if( tempFrogger.isHasFlower()){
			((FroggerGame)obj).setWin(true);
		}
	}
	/**
	 * @author imran
	 */
	@Override
	public boolean equals(Object obj){
		if(!(obj instanceof Home)){ return false; }
		return super.equals(obj);
	}
}
